export const formatDuration = (hours: number): string => {
  if (hours >= 168) {
    return `${Math.floor(hours / 168)} Week${hours >= 336 ? 's' : ''}`
  }
  if (hours >= 24) {
    return `${Math.floor(hours / 24)} Day${hours >= 48 ? 's' : ''}`
  }
  return `${hours} Hour${hours > 1 ? 's' : ''}`
}

export const formatDateTime = (timestamp: string | number): string => {
  if (!timestamp) return ''

  return new Date(timestamp).toLocaleString('en-US', {
    month: 'short',
    day: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
  })
}
